
The @receptron/laya npm package runs Convai Innovations' Laya decision model directly in Node.js and TypeScript via ONNX Runtime without needing Python or PyTorch. It takes a JSON state and typed questions, returning calibrated probabilities for choices, scores, and yes-no statements in a single forward pass taking roughly 140 milliseconds per batch on Apple silicon. The 1.7 GB model weights download automatically on first use, and the TypeScript types match the Python implementation to four decimal places.
It is worth testing if you need structured classification or confidence scoring on text inputs without spinning up an LLM API. The catch is strict input limits: states are truncated at 512 tokens and choice questions top out around 20 options. Skip this if you need generative text or inputs longer than a short support ticket.
Leave a Reply